Skip to content

Add ts2swift Record to Dictionary mapping#582

Merged
kateinoigakukun merged 1 commit intomainfrom
katei/3cb0-please-add-recor
Feb 5, 2026
Merged

Add ts2swift Record to Dictionary mapping#582
kateinoigakukun merged 1 commit intomainfrom
katei/3cb0-please-add-recor

Conversation

@kateinoigakukun
Copy link
Member

Motivation:

  • Support ts2swift translation for Record<string, T> outputs.

Changes:

  • Map Record<string, T> (including alias instantiations) to [String: T] with a warning fallback for non-string keys.
  • Add Record fixture and refresh Vitest snapshot covering nested, optional, array, and object values plus unsupported key coverage.

@kateinoigakukun kateinoigakukun force-pushed the katei/0bd3-bridgejs-support branch from ee19ac2 to aa82380 Compare February 5, 2026 10:17
Base automatically changed from katei/0bd3-bridgejs-support to main February 5, 2026 10:49
…ript/src/processor.js`, mapping `Record<string, T>` to `[String: T]` (with JSObject fallback for non-string keys) by reading alias type arguments even when the type isn’t a `TypeReference`.

- Added a new fixture and refreshed Vitest snapshots to cover dictionary outputs, nested/optional records, array/object values, and unsupported key handling in `Plugins/BridgeJS/Sources/TS2Swift/JavaScript/test/fixtures/RecordDictionary.d.ts` and `.../__snapshots__/ts2swift.test.js.snap`.

Tests: `cd Plugins/BridgeJS/Sources/TS2Swift/JavaScript && npm test -- --update`.
@kateinoigakukun kateinoigakukun force-pushed the katei/3cb0-please-add-recor branch from 228b50f to 25683e4 Compare February 5, 2026 10:52
@kateinoigakukun kateinoigakukun merged commit 6b3a697 into main Feb 5, 2026
11 checks passed
@kateinoigakukun kateinoigakukun deleted the katei/3cb0-please-add-recor branch February 5, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants